\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\b0\i0\ul0\fs28 sendmail outgoing sender name translation mail\
\
Q: How can I translate from a login name (e.g., of the form first initial and a last name) to a canonical alias on outgoing mail (e.g., from “jdoe” to “Jane_Doe”)?\
\
A: We recommend you do this
\b\i\fs32 ONLY
\b0\i0\fs28 if you're comfortable supporting sendmail, modifying sendmail.cf files, and adding custom NIS (formarly known as Yellow Pages) maps. (In other words,
\i this can be dangerous
\i0 if you're unfamiliar with sendmail and NIS.)\
\
Find the area in the
\b sendmail.cf
\b0 file on your mailhost which looks like this:\
\
\f0\fs24\li980 ###########################\
### Rewriting rules ###\
###########################\
\
# Sender Field Pre-rewriting\
S1\
# None needed.\
\li0 \
\f2\fs28 This is the rewriting rule which modifies the sender's address, as noted in the comments. Add the line\
\f0\fs24 \
\li980 DZmail.byaddr\
\li0 \
\f2\fs28 immediately before the “
\f0\fs24 # Sender Field ...
\f2\fs28 ”
\f0\fs24 comment.
\f2\fs28 Replace the “
\f0\fs24 # None needed.
\f2\fs28 ” comment with this:\
\
\f0\fs24\li980 R$- $:$>3$\{Z$1$\} invert account to alias\
\f2\fs28\li0 \
When you're done, this rule will look like this:\
\
\f0\fs24\li980 ###########################\
### Rewriting rules ###\
###########################\
\
DZmail.byaddr\
# Sender Field Pre-rewriting\
S1\
R$- $:$>3$\{Z$1$\} invert account to alias\
\f2\fs28\li0 \
The directive
\f0\fs24 $\{Z$1$\}
\f2\fs28 causes token 1 (the sender's account) to be translated using the NIS map specified by the Z macro. The mail.byaddr NIS map is a custom map which establishes a relationship between accounts and “mail names” (like jdoe and Jane_Doe, shown above). You'll also need to establish a link between the user name (e.g., Jane_Doe) and the account (e.g., jdoe) for incoming mail to the user name to work; the standard aliases mechanisms can be used for this.\
\
If you're using the standard
\b sendmail
\b0 configuration files, we recommend you make a copy of the appropriate configuration file, edit that, and change the
\b sendmail.cf
\b0 symbolic link to reference your custom configuration file.\